package com.mill.scala.controller


import javax.annotation.Resource

import com.mill.scala.mapper.CoursesMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{RequestParam, RequestMapping, RestController}


@RestController
class IndexController @Autowired()(val coursesMapper:CoursesMapper) {



  @RequestMapping(value=Array("/index"))
  def index():AnyRef=coursesMapper.getAll


  @RequestMapping(value=Array("/getOne"))
  def getOne(@RequestParam("id") id:String):AnyRef=coursesMapper.getOne(id)


  @RequestMapping(value=Array("/delete"))
  def delete(@RequestParam("id") id:String):AnyRef=coursesMapper.delete(id)

}
